<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>QuantumLibrary: /bb/mbigc/mbig5696/git/quantum_external/src/util/quantum_sequencer.h Source File</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">QuantumLibrary
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('d4/da2/quantum__sequencer_8h_source.html','../../');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">quantum_sequencer.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">** Copyright 2018 Bloomberg Finance L.P.</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">**</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">** Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">** you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">** You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">**</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">**     http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">**</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">** Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">** distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">** See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">** limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#ifndef BLOOMBERG_QUANTUM_SEQUENCER_H</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#define BLOOMBERG_QUANTUM_SEQUENCER_H</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &lt;quantum/quantum_dispatcher.h&gt;</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &lt;quantum/interface/quantum_ithread_context_base.h&gt;</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &lt;quantum/util/quantum_sequencer_configuration.h&gt;</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#include &lt;quantum/util/quantum_sequence_key_statistics.h&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#include &lt;unordered_map&gt;</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160; </div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="keyword">namespace </span><a class="code" href="../../d6/db9/namespaceBloomberg.html">Bloomberg</a> {</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="keyword">namespace </span>quantum {</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160; </div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment">//==============================================================================================</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment">//                                      class Sequencer</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment">//==============================================================================================</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment"></span>    </div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">class </span>SequenceKey,</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;          <span class="keyword">class </span>Hash = std::hash&lt;SequenceKey&gt;,</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;          <span class="keyword">class </span>KeyEqual = std::equal_to&lt;SequenceKey&gt;,</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;          <span class="keyword">class </span>Allocator = std::allocator&lt;std::pair&lt;const SequenceKey, SequenceKeyData&gt;&gt;&gt;</div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html">   43</a></span>&#160;<span class="keyword">class </span><a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html">Sequencer</a></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;{</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#a8002b0e144b13e677f86c8247c398679">   47</a></span>&#160;    <span class="keyword">using</span> <a class="code" href="../../dd/df2/classBloomberg_1_1quantum_1_1SequencerConfiguration.html">Configuration</a> = <a class="code" href="../../dd/df2/classBloomberg_1_1quantum_1_1SequencerConfiguration.html">SequencerConfiguration&lt;SequenceKey, Hash, KeyEqual, Allocator&gt;</a>;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#afdd8a154a4c2b7c79a825401d58cb542">Sequencer</a>(<a class="code" href="../../d0/da5/classBloomberg_1_1quantum_1_1Dispatcher.html">Dispatcher</a>&amp; dispatcher, <span class="keyword">const</span> <a class="code" href="../../dd/df2/classBloomberg_1_1quantum_1_1SequencerConfiguration.html">Configuration</a>&amp; configuration = <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#a8002b0e144b13e677f86c8247c398679">Configuration</a>());</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class </span>FUNC, <span class="keyword">class </span>... ARGS&gt;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="keywordtype">void</span></div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#a937a0e6d89e61676c3f41fbac6113190">post</a>(<span class="keyword">const</span> SequenceKey&amp; sequenceKey, FUNC&amp;&amp; func, ARGS&amp;&amp;... args);</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class </span>FUNC, <span class="keyword">class </span>... ARGS&gt;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <span class="keywordtype">void</span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#a937a0e6d89e61676c3f41fbac6113190">post</a>(<span class="keywordtype">void</span>* opaque, <span class="keywordtype">int</span> queueId, <span class="keywordtype">bool</span> isHighPriority, <span class="keyword">const</span> SequenceKey&amp; sequenceKey, FUNC&amp;&amp; func, ARGS&amp;&amp;... args);</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class </span>FUNC, <span class="keyword">class </span>... ARGS&gt;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    <span class="keywordtype">void</span></div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#a937a0e6d89e61676c3f41fbac6113190">post</a>(<span class="keyword">const</span> std::vector&lt;SequenceKey&gt;&amp; sequenceKeys, FUNC&amp;&amp; func, ARGS&amp;&amp;... args);</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class </span>FUNC, <span class="keyword">class </span>... ARGS&gt;</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="keywordtype">void</span></div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#a937a0e6d89e61676c3f41fbac6113190">post</a>(<span class="keywordtype">void</span>* opaque,</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;         <span class="keywordtype">int</span> queueId,</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;         <span class="keywordtype">bool</span> isHighPriority,</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;         <span class="keyword">const</span> std::vector&lt;SequenceKey&gt;&amp; sequenceKeys,</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;         FUNC&amp;&amp; func,</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;         ARGS&amp;&amp;... args);</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class </span>FUNC, <span class="keyword">class </span>... ARGS&gt;</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;    <span class="keywordtype">void</span></div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#ac9d8c07adb82569e164e9855bc276d88">postAll</a>(FUNC&amp;&amp; func, ARGS&amp;&amp;... args);</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class </span>FUNC, <span class="keyword">class </span>... ARGS&gt;</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;    <span class="keywordtype">void</span></div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#ac9d8c07adb82569e164e9855bc276d88">postAll</a>(<span class="keywordtype">void</span>* opaque, <span class="keywordtype">int</span> queueId, <span class="keywordtype">bool</span> isHighPriority, FUNC&amp;&amp; func, ARGS&amp;&amp;... args);</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    <span class="keywordtype">size_t</span> <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#abd829f905b972e2de960266916fa0a45">trimSequenceKeys</a>();</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    <span class="keywordtype">size_t</span> <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#a89c2876ae96cd9c1d763913547eea8c3">getSequenceKeyCount</a>();</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;    <a class="code" href="../../df/df6/classBloomberg_1_1quantum_1_1SequenceKeyStatistics.html">SequenceKeyStatistics</a> <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#ac3c32319c7f039aa8dc0239ea4942c0c">getStatistics</a>(<span class="keyword">const</span> SequenceKey&amp; sequenceKey);</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;    <a class="code" href="../../df/df6/classBloomberg_1_1quantum_1_1SequenceKeyStatistics.html">SequenceKeyStatistics</a> <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#ac3c32319c7f039aa8dc0239ea4942c0c">getStatistics</a>();</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;    </div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;    <a class="code" href="../../df/df6/classBloomberg_1_1quantum_1_1SequenceKeyStatistics.html">SequenceKeyStatistics</a> <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#aa34071c93599ed20646264a009b4aa39">getTaskStatistics</a>();</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    <span class="keyword">using</span> ContextMap = std::unordered_map&lt;SequenceKey, SequenceKeyData, Hash, KeyEqual, Allocator&gt;;</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;    <span class="keyword">using</span> ExceptionCallback = <span class="keyword">typename</span> <a class="code" href="../../dd/df2/classBloomberg_1_1quantum_1_1SequencerConfiguration.html#aabd3db440cc463746587bebe7e013742">Configuration::ExceptionCallback</a>;</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class </span>FUNC, <span class="keyword">class </span>... ARGS&gt;</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> waitForTwoDependents(<a class="code" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a8cf6f8fd7d169988428556468b333fe1">CoroContextPtr&lt;int&gt;</a> ctx,</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;                                    <span class="keywordtype">void</span>* opaque,</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;                                    <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html">Sequencer</a>&amp; sequencer,</div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;                                    <a class="code" href="../../d6/de7/structBloomberg_1_1quantum_1_1SequenceKeyData.html">SequenceKeyData</a>&amp;&amp; dependent,</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;                                    <a class="code" href="../../d6/de7/structBloomberg_1_1quantum_1_1SequenceKeyData.html">SequenceKeyData</a>&amp;&amp; universalDependent,</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;                                    FUNC&amp;&amp; func,</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;                                    ARGS&amp;&amp;... args);</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class </span>FUNC, <span class="keyword">class </span>... ARGS&gt;</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> waitForDependents(<a class="code" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a8cf6f8fd7d169988428556468b333fe1">CoroContextPtr&lt;int&gt;</a> ctx,</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;                                 <span class="keywordtype">void</span>* opaque,</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;                                 <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html">Sequencer</a>&amp; sequencer,</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;                                 std::vector&lt;SequenceKeyData&gt;&amp;&amp; dependents,</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;                                 <a class="code" href="../../d6/de7/structBloomberg_1_1quantum_1_1SequenceKeyData.html">SequenceKeyData</a>&amp;&amp; universalDependent,</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;                                 FUNC&amp;&amp; func,</div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;                                 ARGS&amp;&amp;... args);</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class </span>FUNC, <span class="keyword">class </span>... ARGS&gt;</div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> waitForUniversalDependent(<a class="code" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a8cf6f8fd7d169988428556468b333fe1">CoroContextPtr&lt;int&gt;</a> ctx,</div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;                                         <span class="keywordtype">void</span>* opaque,</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;                                         <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html">Sequencer</a>&amp; sequencer,</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;                                         std::vector&lt;SequenceKeyData&gt;&amp;&amp; dependents,</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;                                         <a class="code" href="../../d6/de7/structBloomberg_1_1quantum_1_1SequenceKeyData.html">SequenceKeyData</a>&amp;&amp; universalDependent,</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;                                         FUNC&amp;&amp; func,</div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;                                         ARGS&amp;&amp;... args);</div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class </span>FUNC, <span class="keyword">class </span>... ARGS&gt;</div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> singleSequenceKeyTaskScheduler(</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;                                    <a class="code" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a8cf6f8fd7d169988428556468b333fe1">CoroContextPtr&lt;int&gt;</a> ctx,</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;                                    <span class="keywordtype">void</span>* opaque,</div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;                                    <span class="keywordtype">int</span> queueId,</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;                                    <span class="keywordtype">bool</span> isHighPriority,</div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;                                    <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html">Sequencer</a>&amp; sequencer,</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;                                    SequenceKey&amp;&amp; sequenceKey,</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;                                    FUNC&amp;&amp; func,</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;                                    ARGS&amp;&amp;... args);</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class </span>FUNC, <span class="keyword">class </span>... ARGS&gt;</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> multiSequenceKeyTaskScheduler(</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;                                    <a class="code" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a8cf6f8fd7d169988428556468b333fe1">CoroContextPtr&lt;int&gt;</a> ctx,</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;                                    <span class="keywordtype">void</span>* opaque,</div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;                                    <span class="keywordtype">int</span> queueId,</div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;                                    <span class="keywordtype">bool</span> isHighPriority,</div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;                                    <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html">Sequencer</a>&amp; sequencer,</div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;                                    std::vector&lt;SequenceKey&gt;&amp;&amp; sequenceKeys,</div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;                                    FUNC&amp;&amp; func,</div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;                                    ARGS&amp;&amp;... args);</div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class </span>FUNC, <span class="keyword">class </span>... ARGS&gt;</div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> universalTaskScheduler(</div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;                                    <a class="code" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a8cf6f8fd7d169988428556468b333fe1">CoroContextPtr&lt;int&gt;</a> ctx,</div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;                                    <span class="keywordtype">void</span>* opaque,</div><div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;                                    <span class="keywordtype">int</span> queueId,</div><div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;                                    <span class="keywordtype">bool</span> isHighPriority,</div><div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;                                    <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html">Sequencer</a>&amp; sequencer,</div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;                                    FUNC&amp;&amp; func,</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;                                    ARGS&amp;&amp;... args);</div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class </span>FUNC, <span class="keyword">class </span>... ARGS&gt;</div><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> callPosted(<a class="code" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a8cf6f8fd7d169988428556468b333fe1">CoroContextPtr&lt;int&gt;</a> ctx,</div><div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;                           <span class="keywordtype">void</span>* opaque,</div><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;                           <span class="keyword">const</span> <a class="code" href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html">Sequencer</a>&amp; sequencer,</div><div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;                           FUNC&amp;&amp; func,</div><div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;                           ARGS&amp;&amp;... args);</div><div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;</div><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">bool</span> canTrimContext(<span class="keyword">const</span> <a class="code" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#ab01325c808be994b5ce507dab2de2161">ICoroContextBasePtr</a>&amp; ctx,</div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;                               <span class="keyword">const</span> <a class="code" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#ab01325c808be994b5ce507dab2de2161">ICoroContextBasePtr</a>&amp; ctxToValidate);</div><div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">bool</span> isPendingContext(<span class="keyword">const</span> <a class="code" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#ab01325c808be994b5ce507dab2de2161">ICoroContextBasePtr</a>&amp; ctx,</div><div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;                                 <span class="keyword">const</span> <a class="code" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#ab01325c808be994b5ce507dab2de2161">ICoroContextBasePtr</a>&amp; ctxToValidate);</div><div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;</div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;    <a class="code" href="../../d0/da5/classBloomberg_1_1quantum_1_1Dispatcher.html">Dispatcher</a>&amp;              _dispatcher;</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;    <span class="keywordtype">int</span>                      _controllerQueueId;</div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;    <a class="code" href="../../d6/de7/structBloomberg_1_1quantum_1_1SequenceKeyData.html">SequenceKeyData</a>          _universalContext;</div><div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;    ContextMap               _contexts;</div><div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;    ExceptionCallback        _exceptionCallback;</div><div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;    std::shared_ptr&lt;SequenceKeyStatisticsWriter&gt; _taskStats;</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;};</div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;</div><div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;}}</div><div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;</div><div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;<span class="preprocessor">#include &lt;quantum/util/impl/quantum_sequencer_impl.h&gt;</span></div><div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;</div><div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;<span class="preprocessor">#endif //BLOOMBERG_QUANTUM_SEQUENCER_H</span></div><div class="ttc" id="classBloomberg_1_1quantum_1_1Sequencer_html_afdd8a154a4c2b7c79a825401d58cb542"><div class="ttname"><a href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#afdd8a154a4c2b7c79a825401d58cb542">Bloomberg::quantum::Sequencer::Sequencer</a></div><div class="ttdeci">Sequencer(Dispatcher &amp;dispatcher, const Configuration &amp;configuration=Configuration())</div><div class="ttdoc">Constructor.</div><div class="ttdef"><b>Definition:</b> quantum_sequencer_impl.h:28</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1Sequencer_html_aa34071c93599ed20646264a009b4aa39"><div class="ttname"><a href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#aa34071c93599ed20646264a009b4aa39">Bloomberg::quantum::Sequencer::getTaskStatistics</a></div><div class="ttdeci">SequenceKeyStatistics getTaskStatistics()</div><div class="ttdoc">Gets the sequencer statistics for all jobs.</div><div class="ttdef"><b>Definition:</b> quantum_sequencer_impl.h:226</div></div>
<div class="ttc" id="namespaceBloomberg_html"><div class="ttname"><a href="../../d6/db9/namespaceBloomberg.html">Bloomberg</a></div><div class="ttdef"><b>Definition:</b> quantum_buffer_impl.h:22</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1Sequencer_html_ac3c32319c7f039aa8dc0239ea4942c0c"><div class="ttname"><a href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#ac3c32319c7f039aa8dc0239ea4942c0c">Bloomberg::quantum::Sequencer::getStatistics</a></div><div class="ttdeci">SequenceKeyStatistics getStatistics()</div><div class="ttdoc">Gets the sequencer statistics for the 'universal key', a.k.a. posted via postAll() method.</div><div class="ttdef"><b>Definition:</b> quantum_sequencer_impl.h:219</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1Sequencer_html_abd829f905b972e2de960266916fa0a45"><div class="ttname"><a href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#abd829f905b972e2de960266916fa0a45">Bloomberg::quantum::Sequencer::trimSequenceKeys</a></div><div class="ttdeci">size_t trimSequenceKeys()</div><div class="ttdoc">Trims the sequence keys not used by the sequencer anymore.</div><div class="ttdef"><b>Definition:</b> quantum_sequencer_impl.h:184</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1Sequencer_html_a937a0e6d89e61676c3f41fbac6113190"><div class="ttname"><a href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#a937a0e6d89e61676c3f41fbac6113190">Bloomberg::quantum::Sequencer::post</a></div><div class="ttdeci">void post(const SequenceKey &amp;sequenceKey, FUNC &amp;&amp;func, ARGS &amp;&amp;... args)</div><div class="ttdoc">Post a coroutine to run asynchronously.</div><div class="ttdef"><b>Definition:</b> quantum_sequencer_impl.h:49</div></div>
<div class="ttc" id="namespaceBloomberg_1_1quantum_html_a8cf6f8fd7d169988428556468b333fe1"><div class="ttname"><a href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a8cf6f8fd7d169988428556468b333fe1">Bloomberg::quantum::CoroContextPtr</a></div><div class="ttdeci">typename ICoroContext&lt; RET &gt;::Ptr CoroContextPtr</div><div class="ttdef"><b>Definition:</b> quantum_icoro_context.h:479</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1SequencerConfiguration_html"><div class="ttname"><a href="../../dd/df2/classBloomberg_1_1quantum_1_1SequencerConfiguration.html">Bloomberg::quantum::SequencerConfiguration</a></div><div class="ttdoc">Implementation of a configuration class for Sequencer.</div><div class="ttdef"><b>Definition:</b> quantum_sequencer_configuration.h:41</div></div>
<div class="ttc" id="namespaceBloomberg_1_1quantum_html_ab01325c808be994b5ce507dab2de2161"><div class="ttname"><a href="../../dc/d48/namespaceBloomberg_1_1quantum.html#ab01325c808be994b5ce507dab2de2161">Bloomberg::quantum::ICoroContextBasePtr</a></div><div class="ttdeci">ICoroContextBase::Ptr ICoroContextBasePtr</div><div class="ttdef"><b>Definition:</b> quantum_icoro_context_base.h:79</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1Dispatcher_html"><div class="ttname"><a href="../../d0/da5/classBloomberg_1_1quantum_1_1Dispatcher.html">Bloomberg::quantum::Dispatcher</a></div><div class="ttdoc">Parallel execution engine used to run coroutines or IO tasks asynchronously. This class is the main e...</div><div class="ttdef"><b>Definition:</b> quantum_dispatcher.h:34</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1SequenceKeyStatistics_html"><div class="ttname"><a href="../../df/df6/classBloomberg_1_1quantum_1_1SequenceKeyStatistics.html">Bloomberg::quantum::SequenceKeyStatistics</a></div><div class="ttdoc">Implementation of a statistics collection for a SequenceKey in Sequencer.</div><div class="ttdef"><b>Definition:</b> quantum_sequence_key_statistics.h:32</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1SequenceKeyData_html"><div class="ttname"><a href="../../d6/de7/structBloomberg_1_1quantum_1_1SequenceKeyData.html">Bloomberg::quantum::SequenceKeyData</a></div><div class="ttdef"><b>Definition:</b> quantum_sequencer_configuration_impl.h:28</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1SequencerConfiguration_html_aabd3db440cc463746587bebe7e013742"><div class="ttname"><a href="../../dd/df2/classBloomberg_1_1quantum_1_1SequencerConfiguration.html#aabd3db440cc463746587bebe7e013742">Bloomberg::quantum::SequencerConfiguration::ExceptionCallback</a></div><div class="ttdeci">std::function&lt; void(std::exception_ptr exception, void *opaque)&gt; ExceptionCallback</div><div class="ttdoc">Callback for unhandled exceptions in tasks posted to Sequencer.</div><div class="ttdef"><b>Definition:</b> quantum_sequencer_configuration.h:48</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1Sequencer_html_a89c2876ae96cd9c1d763913547eea8c3"><div class="ttname"><a href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#a89c2876ae96cd9c1d763913547eea8c3">Bloomberg::quantum::Sequencer::getSequenceKeyCount</a></div><div class="ttdeci">size_t getSequenceKeyCount()</div><div class="ttdoc">Gets the number of tracked sequence keys.</div><div class="ttdef"><b>Definition:</b> quantum_sequencer_impl.h:233</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1Sequencer_html_a8002b0e144b13e677f86c8247c398679"><div class="ttname"><a href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#a8002b0e144b13e677f86c8247c398679">Bloomberg::quantum::Sequencer::Configuration</a></div><div class="ttdeci">SequencerConfiguration&lt; SequenceKey, Hash, KeyEqual, Allocator &gt; Configuration</div><div class="ttdoc">Configuration class for Sequencer.</div><div class="ttdef"><b>Definition:</b> quantum_sequencer.h:47</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1Sequencer_html_ac9d8c07adb82569e164e9855bc276d88"><div class="ttname"><a href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html#ac9d8c07adb82569e164e9855bc276d88">Bloomberg::quantum::Sequencer::postAll</a></div><div class="ttdeci">void postAll(FUNC &amp;&amp;func, ARGS &amp;&amp;... args)</div><div class="ttdoc">Post a coroutine to run asynchronously.</div><div class="ttdef"><b>Definition:</b> quantum_sequencer_impl.h:144</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1Sequencer_html"><div class="ttname"><a href="../../d7/d45/classBloomberg_1_1quantum_1_1Sequencer.html">Bloomberg::quantum::Sequencer</a></div><div class="ttdoc">Implementation of a key-based task sequencing with quantum.</div><div class="ttdef"><b>Definition:</b> quantum_sequencer.h:43</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="../../dir_b7878ad5ecbf2506f4125b9d34c97e45.html">util</a></li><li class="navelem"><b>quantum_sequencer.h</b></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
  </ul>
</div>
</body>
</html>
